• File: REEFT_get_current_url.php
  • Full Path: C:/htdocs/REEFTintegrationLog_test/REEFTintegrationLog/include/REEFT_get_current_url.php
  • Date Modified: 04/30/2025 7:56 AM
  • File size: 711 bytes
  • MIME-type: text/x-php
  • Charset: utf-8
<?php
//======================================================================================
//
// Function: Get current URL
// 
// Programmer: JJ
// Date      : 2024-01-02
//
// Copyright Reeft A/S (c) - 2024
//======================================================================================
function REEFT_get_current_url() 
{
	
		$wrk_URL 	= parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
		$pgm_name 	= basename($_SERVER['PHP_SELF']);

		// Remove current program name
		$wrk_URL 	= str_replace($pgm_name, '', $wrk_URL);
	
		// HTTP type
		$actual_link = (empty($_SERVER['HTTPS']) ? 'http' : 'https') . "://$_SERVER[HTTP_HOST]$wrk_URL";		
		
		return $actual_link;
	
}
?>